#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <chrono>

using namespace std;

static bool triangle_containment_area(const pair<int, int>& a, const pair<int, int>& b, const pair<int, int>& c) {
    auto double_area = [](const pair<int, int>& a, const pair<int, int>& b, const pair<int, int>& c) {
        return abs((b.first - a.first) * (c.second - a.second) - (b.second - a.second) * (c.first - a.first));
    };
    constexpr pair<int, int> o {0, 0};
    int s1 {double_area(a, b, o)};
    int s2 {double_area(a, c, o)};
    int s3 {double_area(b, c, o)};
    int s0 {double_area(a, b, c)};
    // cout << s1 << " + " << s2 << " + " << s3 << " ?= " << s0 << endl;
    return s0 == s1 + s2 + s3;
}

static bool triangle_containment_angle(const pair<int, int>& a, const pair<int, int>& b, const pair<int, int>& c) {
    auto angle = [](const pair<int, int>& a, const pair<int, int>& b, const pair<int, int>& c) {
        double modulo_ba = sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
        double modulo_bc = sqrt((c.first - b.first) * (c.first - b.first) + (c.second - b.second) * (c.second - b.second));
        double point_product = (a.first - b.first) * (c.first - b.first) + (a.second - b.second) * (c.second - b.second);
        return acos(point_product / modulo_ba / modulo_bc);
    };
    constexpr pair<int, int> o {0, 0};
    double aob {angle(a, o, b)};
    double boc {angle(b, o, c)};
    double coa {angle(c, o, a)};
    // cout << aob << ' ' << boc << ' ' << coa << endl;
    constexpr double limit = 2 * M_PI - 1e-6;
    return aob + boc + coa > limit;
}

int main() {
    {
        auto func = triangle_containment_area;
        auto t0 = chrono::high_resolution_clock::now();
        int ans = 0;
        string line;
        ifstream file {"./102.txt"};
        while (getline(file, line)) {
            vector<int> v;
            stringstream ss {line};
            string token;
            while (getline(ss, token, ',')) 
                v.push_back(stoi(token));
            int x1 = v[0], y1 = v[1];
            int x2 = v[2], y2 = v[3];
            int x3 = v[4], y3 = v[5];
            ans += func({x1, y1}, {x2, y2}, {x3, y3});
        }
        cout << ans << ' ';
        file.close();
        auto t1 = chrono::high_resolution_clock::now();
        auto elapsed = t1 - t0;
        cout << elapsed.count() << " microseconds" << endl;
    }
    {
        auto func = triangle_containment_angle;
        auto t0 = chrono::high_resolution_clock::now();
        int ans = 0;
        string line;
        ifstream file {"./102.txt"};
        while (getline(file, line)) {
            vector<int> v;
            stringstream ss {line};
            string token;
            while (getline(ss, token, ',')) 
                v.push_back(stoi(token));
            int x1 = v[0], y1 = v[1];
            int x2 = v[2], y2 = v[3];
            int x3 = v[4], y3 = v[5];
            ans += func({x1, y1}, {x2, y2}, {x3, y3});
        }
        cout << ans << ' ';
        file.close();
        auto t1 = chrono::high_resolution_clock::now();
        auto elapsed = t1 - t0;
        cout << elapsed.count() << " microseconds" << endl;
    }
}